package com.scs.application.modules.upms.controller;

import com.scs.application.core.model.CommonResult;
import com.scs.application.core.mvc.controller.BaseController;
import com.scs.application.modules.upms.dto.UsernameAndPasswordLoginDTO;
import com.scs.application.modules.upms.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: sso登录，之前的登录接口慢慢向这边转移
 */
@Slf4j
@RestController
@RequestMapping("/upms/sso")
public class SsoLoginController extends BaseController {

    @Autowired
    private LoginService loginService;

    /**
     * 用于接口登录
     * @param dto
     * @return
     */
    @GetMapping("/thirdparty_login")
    public CommonResult login(UsernameAndPasswordLoginDTO dto) {

        return CommonResult.ok("登录成功", loginService.login(dto));
    }

}
